package com.hackerrank.challenges.encryption;

import java.util.Scanner;

public class Solution {
	/**
	 * @param args
	 */
	public static void main(String[] args) {
		Scanner in = new Scanner(System.in);
		String s = in.nextLine();
		int f = (int)Math.floor(Math.sqrt(s.length())), nr = f, nc = f;
		if(nr * nc < s.length())
			nc++;
		if(nr * nc < s.length())
			nr++;
		for(int c = 0; c < nc; c++) {
			for(int r = 0; r < nr; r++)
				if(r * nc + c < s.length())
					System.out.print(s.charAt(r * nc + c));
			System.out.print(" ");
		}
		System.out.println();
	}
}
